//
//  CFTokenManager.m
//  CFfuturestalent
//
//  Created by chunfeng on 2018/5/30.
//  Copyright © 2018年 子yu 刘. All rights reserved.
//

#import "CFTokenManager.h"

NSString *const TOKEN_KEY = @"token";

@implementation CFTokenManager


+ (void)saveToken:(NSString *)token{
    NSUserDefaults *userDefaults=[NSUserDefaults standardUserDefaults];
    [userDefaults setObject:token forKey:TOKEN_KEY];
    [userDefaults synchronize];
}

+ (NSString *)getToken{
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    NSString *tokenData = [userDefaults objectForKey:TOKEN_KEY];
    [userDefaults synchronize];
    
    return tokenData?tokenData:@"";
}

+ (void)cleanToken{
    NSUserDefaults *UserLoginState = [NSUserDefaults standardUserDefaults];
    [UserLoginState removeObjectForKey:TOKEN_KEY];
    [UserLoginState synchronize];
}

+ (NSString *)refreshToken{
        return @"";
}
@end
